<?php

header( 'Content-Type: text/javascript' );

session_start();

if ( !empty( $_SESSION['name'] ) )
	die( 'name="' . addslashes( $_SESSION['name'] ) . '"' );

if ( !empty( $_GET['name'] ) && trim( $_GET['name'] ) ) {
	$_SESSION['name'] = trim( $_GET['name'] );
	die( 'location.reload()' );
}

?>name=prompt('What is your name? This will be used as your handle in the chat.','');$.getScript('name.php?name='+encodeURIComponent(name));